﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace city7
{
    public partial class FormLookProd : Form
    {
        public FormLookProd(DataTable dt, string soo)
        {
            InitializeComponent(); InitializeComponentMy(dt, soo);
            
        }
        public void InitializeComponentMy(DataTable dto, string s111)
        {
            dataGridView1.DataSource = dto;
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            
            object ooo = dto.Compute("count(name)", "kol>0");
            object oo = dto.Compute("sum(sd)", "kol>0");

            toolStripLabel1.Text = string.Concat("Количество наименований: ", ooo);
            toolStripLabel3.Text = string.Concat("Сумма: ", oo);

            this.Text = string.Concat("Смена ", s111);

            dataGridView1.Columns[0].HeaderText = "Наименование";
            dataGridView1.Columns[1].HeaderText = "Кол";
            dataGridView1.Columns[2].HeaderText = "Цена";
            dataGridView1.Columns[3].HeaderText = "Сумма";
            this.WindowState = FormWindowState.Maximized;
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {

        }

        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
